package com.wx.mall.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.wx.mall.demo.entity.Demo;
import com.wx.mall.demo.mapper.DemoMapper;
import com.wx.mall.demo.service.IDemoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author j
 * @since 2020-03-23
 */
@Service
public class DemoServiceImpl extends ServiceImpl<DemoMapper, Demo> implements IDemoService {

    @Override
    public List<Demo> list(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        QueryWrapper<Demo> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("name","%demo%");
        queryWrapper.orderByAsc("name");
        return this.baseMapper.selectList(null);
    }
}
